package com.my.zidingyikongjian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.my.zidingyikongjian.R;

public class RegionActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_region);

        initView();

    }

    private void initView() {
        findViewById(R.id.btn_set_region).setOnClickListener(this);
        findViewById(R.id.btn_set_region_irregular).setOnClickListener(this);
        findViewById(R.id.btn_INTERSECT_region).setOnClickListener(this);
        findViewById(R.id.btn_translate_region).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_set_region: // set设置
                goIntent("1");
                break;
            case R.id.btn_set_region_irregular: // set设置
                goIntent("2");
                break;
            case R.id.btn_INTERSECT_region: // set设置
                goIntent("3");
                break;
            case R.id.btn_translate_region: // set设置
                goIntent("4");
                break;
        }
    }

    private void goIntent(String flag) {
        Intent intent = new Intent(RegionActivity.this, DrawRegionActivity.class);
        intent.putExtra("three", flag);
        startActivity(intent);
    }
}
